﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true"
    Codebehind="userAE.aspx.cs" Inherits="CMS.admin.userAE" Title="Hệ thống quản trị nội dung - Quản lý người dùng" %>

<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="border: solid 1px #ccc;">
        <div id="toolbox">
            <div class="header" style="float: left; margin-left: -40px;">
                <img src="../images/Toolbox/title-article.png" alt="" id="imgHeader" />
                Quản lý người dùng: thêm/sửa
            </div>
            <div style="float: right;">
                <table class="toolbar">
                    <tr>
                        <td align="center">
                            <asp:LinkButton ID="btnUpdate" runat="server" OnClick="btnUpdate_Click">
                                <asp:Label ID="Label1" CssClass="Icon-32-Save" runat="server" />
                                Cập nhật
                            </asp:LinkButton>
                        </td>
                        <td align="center">
                            <asp:LinkButton ID="btnClose" CausesValidation="false" runat="server" OnClick="btnClose_Click">
                                <asp:Label ID="Label4" CssClass="Icon-32-Cancel" runat="server" />
                                Đóng lại
                            </asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <p align="center">
        <br />
        <asp:Label ID="lblMessage" runat="server" BackColor="White" BorderColor="White" ForeColor="Red"></asp:Label>
    </p>
    <div id="content-box">
        <div class="t">
            <div class="t">
                <div class="t">
                </div>
            </div>
        </div>
        <div class="m" style="height: 100%;">
            <!--table2:data form-->
            <table width="830" cellpadding="5" border="0" cellspacing="5">
                <tr>
                    <td align="right" style="width: 150px">
                        <asp:Label ID="lblGroupName" runat="server" Text="Tên nhóm:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:DropDownList ID="ddlGroup" runat="Server" Width="200px">
                        </asp:DropDownList><font color="#ff0000"> *</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlGroup"
                            ErrorMessage="Hãy chọn một nhóm người dùng" InitialValue="0"></asp:RequiredFieldValidator>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Label ID="lblStatus" runat="server" Text="Trạng thái:"></asp:Label>
                        <asp:RadioButton ID="rdActive" runat="server" Checked="true" GroupName="rdgTrangThai"
                            Text="Hoạt động" />
                        <asp:RadioButton ID="rdInActive" runat="server" GroupName="rdgTrangThai" Text="Không hoạt động" />
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px" valign="top">
                        <asp:Label ID="Label2" runat="server" Text="Tên đăng nhập:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtUserName" runat="Server" Width="200px"></asp:TextBox>
                        <font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtUserName"
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px" valign="top">
                        <asp:Label ID="lblFullName" runat="server" Text="Họ tên:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtFullName" runat="Server" Width="200px"></asp:TextBox>
                        <font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtFullName"
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <%-- update user--%>
                <%if (id > 0)
                  {%>
                <tr>
                    <td align="right" style="width: 150px" valign="top">
                        <asp:Label ID="Label3" runat="server" Text="Mật khẩu:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:LinkButton ID="linkChangePass" runat="Server" Text="Đổi mật khẩu" OnClick="linkChangePass_Click"></asp:LinkButton>
                    </td>
                </tr>
                <%-- new user--%>
                <%} %>
                <%  else
                    { %>
                <tr>
                    <td align="right" style="width: 150px" valign="top">
                        <asp:Label ID="Label5" runat="server" Text="Mật khẩu:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtPass" runat="Server" Width="200px" TextMode="Password"></asp:TextBox>
                        <font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtPass"
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px" valign="top">
                        <asp:Label ID="Label6" runat="server" Text="Nhập lại mật khẩu:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtRePass" runat="Server" Width="200px" TextMode="Password"></asp:TextBox>
                        <font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtRePass"
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="CompareValidator2" Font-Size="8" runat="server" ControlToCompare="txtPass"
                            ControlToValidate="txtRePass" ErrorMessage="Mật khẩu không khớp nhau" SetFocusOnError="true"
                            Display="Dynamic"></asp:CompareValidator>
                    </td>
                </tr>
                <%} %>
                <tr>
                    <td align="right" style="width: 150px" valign="top">
                        <asp:Label ID="Label7" runat="server" Text="Thư điện tử:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtEmail" runat="Server" Width="200px"></asp:TextBox>
                        <font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtEmail"
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail"
                            ValidationExpression="^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$"
                            ErrorMessage="Không đúng định dạng email" SetFocusOnError="true" />
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px" valign="top">
                        <asp:Label ID="Label8" runat="server" Text="Điện thoại:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtTel" runat="Server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <!--end:table2-->
            <table width="830" cellpadding="5" border="0" cellspacing="5">
                <tr>
                    <td align="left" style="width: 150px">
                        <asp:Label ID="Label9" runat="server" Text="Gán dịch vụ:" Font-Bold="true"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: left;">
                        <ComponentArt:Grid ID="Grd1" EnableViewState="true" AllowEditing="true" EditOnClickSelectedItem="false"
                            ShowHeader="False" CssClass="Grid" KeyboardEnabled="false" FooterCssClass="GridFooter"
                            AutoCallBackOnDelete="true" AllowHtmlContent="true" PagerStyle="Numbered"
                            PagerTextCssClass="PagerText" PageSize="15" ImagesBaseUrl="../images/" LoadingPanelClientTemplateId="LoadingFeedbackTemplate"
                            Width="830" LoadingPanelPosition="MiddleCenter" runat="server">
                            <Levels>
                                <ComponentArt:GridLevel RowCssClass="Row" AlternatingRowCssClass="AlternatingRow"
                                    DataCellCssClass="DataCell" HeadingCellCssClass="HeadingCell" HeadingTextCssClass="HeadingCellText"
                                    SortAscendingImageUrl="asc.gif" SortDescendingImageUrl="desc.gif" SortImageWidth="9"
                                    SortImageHeight="5">
                                    <Columns>
                                        <ComponentArt:GridColumn Align="Center"  AllowSorting="False" Width="30" HeadingText="<img src='../images/selected.gif' border='0' />"
                                            AllowEditing="True" DataField="Active" ColumnType="CheckBox" />
                                        <ComponentArt:GridColumn Align="Center" Width="40" DataCellServerTemplateId="TempSelect"
                                            DataField="serviceId" HeadingText=""  AllowSorting="False" Visible="false"/>
                                        <%--<ComponentArt:GridColumn Align="Center" DataCellClientTemplateId="chkTemplate" DataField="serviceId"
                                            HeadingText="<img src='../images/selected.gif' border='0' />" Width="40" AllowSorting="false" />--%>
                                        <ComponentArt:GridColumn DataField="serviceName" HeadingText="Tên dịch vụ" Width="100" />
                                        <ComponentArt:GridColumn DataField="linkUrl" HeadingText="Liên kết" Width="100" />
                                        <ComponentArt:GridColumn DataField="status" HeadingText="Hoạt động" Width="70" AllowSorting="false"
                                            DataCellClientTemplateId="StatusTemplate" />
                                        <ComponentArt:GridColumn DataField="support2G" HeadingText="Hỗ trợ/2G" Width="70"
                                            AllowSorting="false" DataCellClientTemplateId="Template2G" />
                                        <ComponentArt:GridColumn DataField="support3G" HeadingText="Hỗ trợ/3G" Width="70"
                                            AllowSorting="false" DataCellClientTemplateId="Template3G" />
                                    </Columns>
                                </ComponentArt:GridLevel>
                            </Levels>
                            <ClientTemplates>
                                <ComponentArt:ClientTemplate ID="chkTemplate" runat="server">
                                    <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td align="center" style="padding-left: 0px;">
                                                <input type="checkbox" class="checkbox" value="## DataItem.GetMember('serviceId').Value ##"
                                                    name="serviceId" id="serviceId" />
                                            </td>
                                        </tr>
                                    </table>
                                </ComponentArt:ClientTemplate>
                                <ComponentArt:ClientTemplate ID="StatusTemplate" runat="server">
                                    <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td align="center" style="padding-left: 5px;">
                                                ## if(DataItem.GetMember("status").Value == 1) { '<img src="../images/tick.png" border="0" />'
                                                } ## ## if(DataItem.GetMember("status").Value == 0) { '<img src="../images/publish_x.png"
                                                    border="0" />' } ##
                                            </td>
                                        </tr>
                                    </table>
                                </ComponentArt:ClientTemplate>
                                <ComponentArt:ClientTemplate ID="Template2G" runat="server">
                                    <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td align="center" style="padding-left: 5px;">
                                                ## if(DataItem.GetMember("support2G").Value == 1) { '<img src="../images/tick.png"
                                                    border="0" />' } ## ## if(DataItem.GetMember("support2G").Value == 0) { '<img src="../images/publish_x.png"
                                                        border="0" />' } ##
                                            </td>
                                        </tr>
                                    </table>
                                </ComponentArt:ClientTemplate>
                                <ComponentArt:ClientTemplate ID="Template3G" runat="server">
                                    <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td align="center" style="padding-left: 5px;">
                                                ## if(DataItem.GetMember("support3G").Value == 1) { '<img src="../images/tick.png"
                                                    border="0" />' } ## ## if(DataItem.GetMember("support3G").Value == 0) { '<img src="../images/publish_x.png"
                                                        border="0" />' } ##
                                            </td>
                                        </tr>
                                    </table>
                                </ComponentArt:ClientTemplate>
                                <ComponentArt:ClientTemplate ID="LoadingFeedbackTemplate" runat="server">
                                    <table cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td style="font-size: 10px;">
                                                Đang tải...&nbsp;</td>
                                            <td>
                                                <img src="../images/spinner.gif" border="0"></td>
                                        </tr>
                                    </table>
                                </ComponentArt:ClientTemplate>
                            </ClientTemplates>
                        </ComponentArt:Grid>
                    </td>
                </tr>
            </table>
            <br />
            <div class="clr">
            </div>
        </div>
        <div class="b">
            <div class="b">
                <div class="b">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
